﻿'use strict';
app.controller('registerController', ['$scope', '$location', 'authService', function ($scope, $location, authService) {
    $scope.registerData = {
        userName: "",
        password: "",
        confirmPassword: ""
    };

    $scope.register = function() {
        authService.saveRegistration($scope.registerData).then(function() {
            $location.path("/");
        }, function(err) {
            $scope.message = err.error_description;
        });
    }
}]);